-
Notifications
You must be signed in to change notification settings - Fork 724
Added check for single exposed port and handle startup command and target port in app service #12088
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
Merged
Merged
Added check for single exposed port and handle startup command and target port in app service #12088
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c462688
Added check for single exposed port and handle startup command and ta…
ShilpiR 75569d7
Nit fix in setting target port
ShilpiR 6ae73c1
Removing unrelated change
ShilpiR e641e6c
Added tests for adding app service with startup args and endpoints
ShilpiR 01ad323
nit fix
ShilpiR e91cead
Fixed error message
ShilpiR 32de02e
minor test change
ShilpiR File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
...e.Hosting.Azure.Tests/Snapshots/AzureAppServiceTests.AddAppServiceWithArgs.verified.bicep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| @description('The location for the resource(s) to be deployed.') | ||
| param location string = resourceGroup().location | ||
|
|
||
| param env_outputs_azure_container_registry_endpoint string | ||
|
|
||
| param env_outputs_planid string | ||
|
|
||
| param env_outputs_azure_container_registry_managed_identity_id string | ||
|
|
||
| param env_outputs_azure_container_registry_managed_identity_client_id string | ||
|
|
||
| param project2_containerimage string | ||
|
|
||
| param project2_containerport string | ||
|
|
||
| param env_outputs_azure_app_service_dashboard_uri string | ||
|
|
||
| param env_outputs_azure_website_contributor_managed_identity_id string | ||
|
|
||
| param env_outputs_azure_website_contributor_managed_identity_principal_id string | ||
|
|
||
| resource mainContainer 'Microsoft.Web/sites/sitecontainers@2024-11-01' = { | ||
| name: 'main' | ||
| properties: { | ||
| authType: 'UserAssigned' | ||
| image: project2_containerimage | ||
| isMain: true | ||
| startUpCommand: join([ | ||
| '--myarg' | ||
| 'myvalue' | ||
| ], ' ') | ||
| userManagedIdentityClientId: env_outputs_azure_container_registry_managed_identity_client_id | ||
| } | ||
| parent: webapp | ||
| } | ||
|
|
||
| resource webapp 'Microsoft.Web/sites@2024-11-01' = { | ||
| name: take('${toLower('project2')}-${uniqueString(resourceGroup().id)}', 60) | ||
| location: location | ||
| properties: { | ||
| serverFarmId: env_outputs_planid | ||
| siteConfig: { | ||
| numberOfWorkers: 30 | ||
| linuxFxVersion: 'SITECONTAINERS' | ||
| acrUseManagedIdentityCreds: true | ||
| acrUserManagedIdentityID: env_outputs_azure_container_registry_managed_identity_client_id | ||
| appSettings: [ | ||
| { | ||
| name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES' | ||
| value: 'true' | ||
| } | ||
| { | ||
| name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES' | ||
| value: 'true' | ||
| } | ||
| { | ||
| name: 'OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY' | ||
| value: 'in_memory' | ||
| } | ||
| { | ||
| name: 'ASPNETCORE_FORWARDEDHEADERS_ENABLED' | ||
| value: 'true' | ||
| } | ||
| { | ||
| name: 'HTTP_PORTS' | ||
| value: project2_containerport | ||
| } | ||
| { | ||
| name: 'services__project1__http__0' | ||
| value: 'http://${take('${toLower('project1')}-${uniqueString(resourceGroup().id)}', 60)}.azurewebsites.net' | ||
| } | ||
| { | ||
| name: 'ASPIRE_ENVIRONMENT_NAME' | ||
| value: 'env' | ||
| } | ||
| { | ||
| name: 'OTEL_SERVICE_NAME' | ||
| value: 'project2' | ||
| } | ||
| { | ||
| name: 'OTEL_EXPORTER_OTLP_PROTOCOL' | ||
| value: 'grpc' | ||
| } | ||
| { | ||
| name: 'OTEL_EXPORTER_OTLP_ENDPOINT' | ||
| value: 'http://localhost:6001' | ||
| } | ||
| { | ||
| name: 'WEBSITE_ENABLE_ASPIRE_OTEL_SIDECAR' | ||
| value: 'true' | ||
| } | ||
| { | ||
| name: 'OTEL_COLLECTOR_URL' | ||
| value: env_outputs_azure_app_service_dashboard_uri | ||
| } | ||
| { | ||
| name: 'OTEL_CLIENT_ID' | ||
| value: env_outputs_azure_container_registry_managed_identity_client_id | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| identity: { | ||
| type: 'UserAssigned' | ||
| userAssignedIdentities: { | ||
| '${env_outputs_azure_container_registry_managed_identity_id}': { } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| resource project2_ra 'Microsoft.Authorization/roleAssignments@2022-04-01' = { | ||
| name: guid(webapp.id, env_outputs_azure_website_contributor_managed_identity_id, subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'de139f84-1756-47ae-9be6-808fbbe84772')) | ||
| properties: { | ||
| principalId: env_outputs_azure_website_contributor_managed_identity_principal_id | ||
| roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'de139f84-1756-47ae-9be6-808fbbe84772') | ||
| principalType: 'ServicePrincipal' | ||
| } | ||
| scope: webapp | ||
| } |
15 changes: 15 additions & 0 deletions
15
...re.Hosting.Azure.Tests/Snapshots/AzureAppServiceTests.AddAppServiceWithArgs.verified.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "type": "azure.bicep.v0", | ||
| "path": "project2.module.bicep", | ||
| "params": { | ||
| "env_outputs_azure_container_registry_endpoint": "{env.outputs.AZURE_CONTAINER_REGISTRY_ENDPOINT}", | ||
| "env_outputs_planid": "{env.outputs.planId}", | ||
| "env_outputs_azure_container_registry_managed_identity_id": "{env.outputs.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID}", | ||
| "env_outputs_azure_container_registry_managed_identity_client_id": "{env.outputs.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_CLIENT_ID}", | ||
| "project2_containerimage": "{project2.containerImage}", | ||
| "project2_containerport": "{project2.containerPort}", | ||
| "env_outputs_azure_app_service_dashboard_uri": "{env.outputs.AZURE_APP_SERVICE_DASHBOARD_URI}", | ||
| "env_outputs_azure_website_contributor_managed_identity_id": "{env.outputs.AZURE_WEBSITE_CONTRIBUTOR_MANAGED_IDENTITY_ID}", | ||
| "env_outputs_azure_website_contributor_managed_identity_principal_id": "{env.outputs.AZURE_WEBSITE_CONTRIBUTOR_MANAGED_IDENTITY_PRINCIPAL_ID}" | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.