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

Error while deploying MWA to Azure #264

Open
mfaulcon opened this issue Nov 8, 2024 · 4 comments
Open

Error while deploying MWA to Azure #264

mfaulcon opened this issue Nov 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@mfaulcon
Copy link

mfaulcon commented Nov 8, 2024

Describe the bug
While executing step 5 in the [Steps to deploy the reference implementation](Steps to deploy the reference implementation) using the option for Visual Studio, the error below was observed:

  (✓) Done: Resource group: rg-sandbox-mwa-eus (337ms)
  (✓) Done: Log Analytics workspace: log-5mhbf4d3c7clm (332ms)
  (✓) Done: Application Insights: appi-5mhbf4d3c7clm (599ms)
  (✓) Done: Azure Front Door / CDN profile: afd-5mhbf4d3c7clm (608ms)
  |  =====| Creating/Updating resources
ERROR: error executing step command 'provision': deployment failed: error deploying infrastructure: deploying to subscription:

Deployment Error Details:
InvalidTemplate: Deployment template validation failed: 'The template output reference to 'Microsoft.Resources/deployments/application-sql-server-5mhbf4d3c7clm' requires an API version. Please see https://aka.ms/arm-syntax for usage details.'.

Examining the deployment error in the Azure portal showed this message:

{"code":"InvalidTemplate","message":"Deployment template validation failed: 'The template output reference to 'Microsoft.Resources/deployments/application-sql-server-5mhbf4d3c7clm' requires an API version. Please see https://aka.ms/arm-syntax for usage details.'.","additionalInfo":[{"type":"TemplateViolation","info":{"lineNumber":0,"linePosition":0,"path":""}}]}

To Reproduce
Steps to reproduce the behavior:

  1. Complete steps 1-4 of the [Steps to deploy the reference implementation](Steps to deploy the reference implementation), using the optional instructions for Visual Studio.
  2. Execute step 5, 'azd up'
  3. See error

Expected behavior
The MWA azure infrastructure is provisioned successfully.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Shell: PowerShell Core
  • Shell Version: PowerShell 7.4.6
  • az version:
          "azure-cli": "2.65.0",
          "azure-cli-core": "2.65.0",
          "azure-cli-telemetry": "1.1.0",
          "extensions": 
               "account": "0.2.5",
               "azure-devops": "1.0.1",
               "azure-firewall": "1.2.0",
               "datafactory": "1.0.2",
               "dns-resolver": "0.2.0",
               "front-door": "1.2.0",
               "gallery-service-artifact": "1.0.0b1",
               "log-analytics": "0.2.2",
               "ml": "2.11.0"
    
  • az bicep version: Bicep CLI version 0.26.170 (e9abaf16a5)
  • azd version: azd version 1.10.4 (commit 5e0b2d56a99bae47a607fa08506da31180bdf540)
  • dotnet version: 8.0.403

Additional context
N/A

@mfaulcon mfaulcon added the bug Something isn't working label Nov 8, 2024
@mjrousos
Copy link
Member

mjrousos commented Nov 8, 2024

Thanks for reporting the issue, @mfaulcon. We'll take a look!

@mjrousos
Copy link
Member

I haven't been able to reproduce this locally. Can you share more details on the error? When you look at the deployment in the Azure Portal, drill down into the nested deployments by clicking on the name of the failed deployment as many times as possible and then share which resource is failing to deploy and the operation details?

@mfaulcon
Copy link
Author

mfaulcon commented Nov 12, 2024

I haven't been able to reproduce this locally. Can you share more details on the error? When you look at the deployment in the Azure Portal, drill down into the nested deployments by clicking on the name of the failed deployment as many times as possible and then share which resource is failing to deploy and the operation details?

The details you see in my original post are the details from the nested deployment. To add further information, in the naming.overrides.jsonc file, I had added overrides for "resourceGroup" and "sqlResourceGroup", among others. This seems to be an issue in application-resources.bicep, line 70, and again in line 277. Once I tried again with the resource groups set to the same value, the deployment completed.

I will note, however, that the execution of create-app-registrations.ps1 failed immediately following - still investigating that.

@mfaulcon
Copy link
Author

I will note, however, that the execution of create-app-registrations.ps1 failed immediately following - still investigating that.

Update - Not sure why, but in order to make create-app-registrations.ps1 work, I had to add the line below:

# Set defaults
+$global:resourceGroups = @{}
$defaultFrontEndAppRegistrationName = "$(Get-WorkloadName -ResourceGroupName $ResourceGroupName)-$(Get-WorkloadEnvironment -ResourceGroupName $ResourceGroupName)-front-webapp-$(Get-WorkloadResourceToken -ResourceGroupName $ResourceGroupName)"

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

No branches or pull requests

2 participants