Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubscriptionNotFound deploying api connections #399

Open
barabetto opened this issue Jun 23, 2023 · 2 comments
Open

SubscriptionNotFound deploying api connections #399

barabetto opened this issue Jun 23, 2023 · 2 comments
Labels
bug Something isn't working 🔍 needs triage Issued needs triaging

Comments

@barabetto
Copy link

Description

I have run the script and everything seemed to be working until it gets to the Deploying api connections where the following message in red appears:
{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/XXX-prod-requestateam-rg-01/providers/Microsoft.Resources/deployments/connections","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."},{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."},{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."},{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."}]}}

The script does seem to be able to access the subscription so I'm not sure what the problem is.

Steps to reproduce

1.Followed the instructions on running the deploy.ps1 script. I have Global Admin access and have entered that when requested.
2.
3.

Expected results

I expected the script to complete without errors

Actual Results

The Resource group has been created in the subscription
The following has been created in the Resource group:
CheckSiteExists Logic app
keyvault
requestateam-kv api conection

Three deployments in the resource group have also failed possibly due to the original subscription error above :
synclabels
{"code":"DeploymentFailed","target":"/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/XXX-prod-requestateam-rg-01/providers/Microsoft.Resources/deployments/synclabels","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ApiConnectionNotFound","message":"The API connection 'requestateam-spo' could not be found."}]}

processtramrequest
{"code":"DeploymentFailed","target":"/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/XXX-prod-requestateam-rg-01/providers/Microsoft.Resources/deployments/processteamrequest","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"MultipleErrorsOccurred","message":"Multiple errors occurred: 'NotFound,NotFound,NotFound,NotFound'."}]}

connections
{"code":"DeploymentFailed","target":"/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/XXX-prod-requestateam-rg-01/providers/Microsoft.Resources/deployments/connections","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."},{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."},{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."},{"code":"SubscriptionNotFound","message":"The subscription 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' could not be found."}]}

Solution component

Deployment Script

Operating system (environment)

Windows

Additional Info

I am running on Windows 10 and using Powershell V5

@barabetto barabetto added bug Something isn't working 🔍 needs triage Issued needs triaging labels Jun 23, 2023
@barabetto
Copy link
Author

barabetto commented Jun 23, 2023

Please see the Powershell comand window output up until the error:

PS C:\Scripts\Powershell\RequestATeamV1.1.0\microsoft-teams-apps-requestateam-1.1.0\Deployment\scripts> ./deploy.ps1 -TenantName "XXX" -TenantID "YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY" -RequestsSiteName "RequestATeamApp" -RequestsSiteDesc "Request a Team App. Used to store Teams Requests" -ManagedPath "sites" -SubscriptionId XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -Location "uksouth" -ResourceGroupName "XXX-prod-requestateam-rg-01" -AppName "XXX-prod-requestateam-app" -ServiceAccountUPN "" -IsEdu $false -KeyVaultName "XXX-prod-rat-kv-01" -EnableSensitivity $false

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust
this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run
C:\Scripts\Powershell\RequestATeamV1.1.0\microsoft-teams-apps-requestateam-1.1.0\Deployment\scripts\deploy.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): r

DEPLOYMENT SCRIPT STARTED

(c) Microsoft Corporation ###
Installing required PowerShell Modules...
Installed modules
_ _
_ __ ___ __ _ _ _ ___ ___ | |_ __ _ | |_ ___ __ _ _ __ ___
| '| / _ \ / || | | | / _ \/ __|| __| _____ / _ | _____ | __| / _ \ / || '_ _
| | | __/| (
| || |
| || /_ | | |
|| (_| |||| |_ | /| (| || | | | | |
|
| _| _, | _,_| _
||/ _| _,| _| ___| _,||| || ||
|_| Launching Azure sign-in... Checking for availability of Key Vault... Key Vault is available. Launching Azure AD sign-in... WARNING: Install the latest PowerShell module, the Microsoft Graph PowerShell SDK, for new features and improvements! https://aka.ms/graphPSmigration Launching Azure CLI sign-in...
WARNING: A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with az login --use-device-code.
Connected to Azure
Launching PnP sign-in...
WARNING:
 
A newer version of PnP PowerShell is available: 2.1.1.
 
Use 'Update-Module -Name PnP.PowerShell' to update.
Use 'Get-PnPChangeLog -Release 2.1.1' to list changes.
 
You can turn this check off by setting the 'PNPPOWERSHELL_UPDATECHECK' environment variable to 'Off'.
 

Connected to SPO

AZURE AD APP CREATION

Creating Azure AD App - 'XXX-prod-requestateam-app'...
Waiting for app to finish creating...
Created Azure AD App
Creating secret for Azure AD App - 'XXX-prod-requestateam-app'...
WARNING: The output includes credentials that you must protect. Be sure that you do not include these credentials in your code or check the credentials into your source control. For more information, see https://aka.ms/azadsp-cli
Created secret for app
Granting admin content for Microsoft Graph...
Waiting for admin consent to finish...
Granted admin consent

AZURE AD APP CREATION FINISHED

TEAMS REQUESTS SITE CREATION

Creating Teams Requests SharePoint site...
Account Environment TenantId TenantDomain AccountType


Admin@XXXX.onmicrosoft.com AzureCloud YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY XXXX.onmicrosoft.com User
https://XXX.sharepoint.com/sites/RequestATeamApp
Site created
TEAMS REQUESTS SITE CREATION COMPLETE

REQUESTS SPO SITE CONFIGURATION

Configuring SharePoint site...
Applying provisioning template...
Applied template
Added settings to Site Requests Settings list
Added templates to Teams Templates list
Adding Service Account to Owners group
Finished configuring site

AZURE RESOURCES DEPLOYMENT

Starting Azure resources deployment...
Creating resource group XXX-prod-requestateam-rg-01...

ResourceGroupName : XXX-prod-requestateam-rg-01
Location : uksouth
ProvisioningState : Succeeded
Tags :
TagsTable :
ResourceId : /subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/XXX-prod-requestateam-rg-01
ManagedBy :

Created resource group
Creating/Updating Key Vault and setting secrets...
You chose to enable the sensitivity label functionality. Make sure the Service Account you use does NOT have MFA enabled.
Finished creating/updating Key Vault and setting secrets
Deploying api connections...
{"status":"Failed","error".....

@SindreWestre
Copy link

I had the same problem.
I found that the "sausername" are wrong:
Open the Azure portal and "Key Vaults", and then click the key vault that the script had created. Choose "Secrets" in the left menu. and click "sausername". Here the username for the service account was wrong. Example: If the username / UPN is some-user@contoso.onmicrosoft.com, the script made it some-user-some-user@contoso.onmicrosoft.com.
I clicked "New version" and put in the correct username/UPN. Then I disabled the old version with the wrong username (cllick the old version and set the "Enabled" toggle to "No".
Then I ran the script again with identical settings as the first time, and choose to keep the existing key vault and overwrite the existing Sharepoint site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🔍 needs triage Issued needs triaging
Projects
None yet
Development

No branches or pull requests

2 participants