melodic-rain-98270
03/27/2023, 12:55 PMGet-AzWebApp
seems to have a Pulumi Azure native command described here: https://www.pulumi.com/registry/packages/azure-native/api-docs/web/getwebapp/
However, is there any way to make this accessible from a user CLI, in a "best practice" kind of way?
Full example of a deployAppService.ps1
script (only for reference to get a better understanding of what kind of logic I am trying to achieve):
Param(
[string]$namePrefix,
[string]$name,
[string]$VirtualDirectory,
[string]$appPlanName,
[string]$appInsightsKey,
[string]$SubscriptionID,
[string]$ResourceGroup,
[bool]$useCosmos = $false
)
Set-Location $PSScriptRoot
$firstimeDeployment = $false
$deploymentTime = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss")
$VirtualDirectory = $VirtualDirectory.Trim("/")
$paths = $VirtualDirectory -split '/'
$gatewaysubnetId = "/subscriptions/$SubscriptionID/resourceGroups/$ResourceGroup/providers/Microsoft.Network/virtualNetworks/$namePrefix-vnet/subnets/$namePrefix-gwsubnet"
$serverFarmId = "/subscriptions/$SubscriptionID/resourceGroups/$ResourceGroup/providers/Microsoft.Web/serverFarms/$namePrefix-$appPlanName"
$webapp = Get-AzWebApp -ResourceGroupName "$ResourceGroup" -Name "$namePrefix-$name" -ErrorAction SilentlyContinue
if(-not $webapp)
{
write-host "web app does not exist, creating both app and slot"
$firstimeDeployment = $true
}
$params = @{namePrefix = "$namePrefix"; name = "$name"; gatewaysubnetId = $gatewaysubnetId; serverFarmId = $serverFarmId; isFirsttimeDeployment = $firstimeDeployment; appInsightsKey = $appInsightsKey; EnableIdentity = $useCosmos}
if($VirtualDirectory -eq "")
{
write-host "Virtual directory is empty, deploying root only template"
$outputs = New-AzResourceGroupDeployment -name "$($name).$($deploymentTime)" -ResourceGroupName "$ResourceGroup" -TemplateFile "..\RootOnly-ssl.json" -TemplateParameterObject $params
$outputs
}
elseif($paths.count -eq 1)
{
write-host "deploying standard template"
$params.Add("VirtualDirectory","$VirtualDirectory")
$outputs = New-AzResourceGroupDeployment -name "$($name).$($deploymentTime)" -ResourceGroupName "$ResourceGroup" -TemplateFile "..\standard-ssl.json" -TemplateParameterObject $params
$outputs
}
elseif($paths.count -eq 2)
{
write-host "Virtual directory contains folder, deploying: DirectoryandPath template"
$params.Add("VirtualDirectory","$VirtualDirectory")
$outputs = New-AzResourceGroupDeployment -name "$($name).$($deploymentTime)" -ResourceGroupName "$ResourceGroup" -TemplateFile "..\DirectoryandPath-ssl.json" -TemplateParameterObject $params
$outputs
}
else
{
Write-Error "Virtual directory is not valid. Virtualdirectory: [$VirtualDirectory]"
}
if($useCosmos)
{
if(-not $outputs.Outputs["identity"].value -or -not $outputs.Outputs["developIdentity"].value){
throw "template deployment outputs does not contain required identities"
}
write-host "cosmos enabled, giving permission to key vault"
write-host "Variables: VaultName: $namePrefix-keyVault-cosmos. ResourceGroup: $ResourceGroup, identity: $($outputs.Outputs['identity'].value). developIdentity: $($outputs.Outputs['developIdentity'].value)"
Set-AzKeyVaultAccessPolicy -VaultName "$namePrefix-keyVault-cosmos" -ResourceGroupName "$ResourceGroup" -ObjectId "$($outputs.Outputs['identity'].value)" -PermissionsToSecrets Get,List -BypassObjectIdValidation
Set-AzKeyVaultAccessPolicy -VaultName "$namePrefix-keyVault-cosmos" -ResourceGroupName "$ResourceGroup" -ObjectId "$($outputs.Outputs['developIdentity'].value)" -PermissionsToSecrets Get,List -BypassObjectIdValidation
}
fancy-artist-45287
03/28/2023, 12:01 PMbest-quill-31250
03/29/2023, 1:14 PMambitious-continent-10899
03/29/2023, 11:43 PMerror: cannot create already existing resource
for the virtualNetworkRulesambitious-continent-10899
03/29/2023, 11:52 PMaz keyvault network-rule add
curved-eye-56312
03/30/2023, 10:10 AM2022-11-01-preview
API version for my Managed Environment . I have checked the Nodejs sdk and apparently this is not available yet (https://github.com/pulumi/pulumi-azure-native/tree/master/sdk/nodejs/app). Does anyone know when this preview version will be available?miniature-leather-70472
03/30/2023, 12:41 PMred-lighter-44012
04/02/2023, 7:01 PMPulumi.Azure Version="3.*" => "5.39.0"
---
+-azure:storage/account:Account: (replace)
[provider: urn:pulumi:*******::*****-Stack::pulumi:providers:azure::default_3_56_0::a73452a7-89a5-4665-b5a1-a7d472984f76 => urn:pulumi:*******::*****-Stack::pulumi:providers:azure::default_5_39_0::output<string>]
...
+ allowNestedItemsToBePublic : true
+ crossTenantReplicationEnabled : true
+ defaultToOauthAuthentication : false
+ infrastructureEncryptionEnabled: false
+ publicNetworkAccessEnabled : true
+ queueEncryptionKeyType : "Service"
+ sftpEnabled : false
+ tableEncryptionKeyType : "Service"
How can I update Pulumi without wrecking the storage account in the process? There should be some upgrade docs with breaking changes, but it seems that between Pulumi updates, Terraform provider versions and Azure API breaking changes, im in a quite the big mess.
And this is just a simple Storage Account with an Azure CDN attached. Next up: AKS, databases and ServicePrincipals 😕brash-musician-70232
04/03/2023, 6:57 AMerror: Code="InternalServerError" Message="An unexpected error occured while processing the request. Tracking ID: '1b8eb450-dc7a-4bc7-8007-43d69d7ea22e'"
. Any idea what could be the issue?curved-doctor-83600
04/03/2023, 1:25 PMrhythmic-activity-46295
04/04/2023, 11:08 AMpowerful-printer-57241
04/06/2023, 10:26 AMazure-native:clientId: ...
azure-native:clientSecret:
secure: ...
azure-native:subscriptionId: ...
azure-native:tenantId: ...
in the stack's config file.
However, with this change, we started getting this error in the GitHub Action:
azure-native:resources:ResourceGroup <resource-group-name> refreshing (22s) error: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account.
What are we missing? I am pretty sure we authenticated in this way before in GitHub Actions.cuddly-napkin-89521
04/06/2023, 2:03 PMautorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Category 'AllLogs' is not supported."
const diagnosticSetting = new insights.DiagnosticSetting("ds-horizon-dev-appinsights", {
name: "ds-horizon-dev-appinsights",
eventHubAuthorizationRuleId: "/subscriptions/70723351-c6d0-4159-b670-ae4aef2e3936/resourcegroups/craftsphere-dev-monitoringaa96adba/providers/Microsoft.EventHub/namespaces/craftsphere-dev-datadog/authorizationrules/craftsphere-dev",
eventHubName: "craftsphere-dev-datadog",
resourceUri: etlAppInsights.id,
logs: [
{
category: "allLogs", <====This part is failing !!!!!
enabled: true,
retentionPolicy: {
days: 0,
enabled: false,
},
}],
metrics: [{
category: "AllMetrics",
enabled: true,
retentionPolicy: {
days: 7,
enabled: false,
},
}],
});
gentle-librarian-84908
04/06/2023, 4:43 PMlittle-library-54601
04/11/2023, 3:26 PMable-thailand-87943
04/12/2023, 1:14 PMquaint-match-50796
04/13/2023, 11:12 AMfancy-artist-45287
04/17/2023, 8:32 AMastonishing-exabyte-93491
04/17/2023, 5:43 PMwhite-helicopter-55877
04/18/2023, 9:41 AMlittle-photographer-8552
04/18/2023, 12:53 PM2023-04-17T23:44:41.1995825Z [90m23:44:41[0m[90m [[0m[97;1mDBG[0m[90m] [0m-- kubernetes:<http://apiextensions.k8s.io/v1:CustomResourceDefinition|apiextensions.k8s.io/v1:CustomResourceDefinition> <http://azureassignedidentities.aadpodidentity.k8s.io|azureassignedidentities.aadpodidentity.k8s.io> deleting original error: '<http://azureassignedidentities.aadpodidentity.k8s.io|azureassignedidentities.aadpodidentity.k8s.io>' timed out waiting to be Ready[0m
At the first attempt we only had this error:
2023-04-17T22:29:50.9776370Z [90m22:29:50[0m[90m [[0m[97;1mDBG[0m[90m] [0m-- kubernetes:<http://helm.sh/v3:Release|helm.sh/v3:Release> tplat-neu-003-nginx-ingress-controller-router deleting original error: uninstall: Release not loaded: nginx-ingress-controller-router: release: not found
any suggestions on how to investigate further here?little-library-54601
04/20/2023, 8:55 PMfast-belgium-1399
04/20/2023, 9:51 PMbitter-postman-91441
04/25/2023, 2:08 PMAddonProfiles =
{
{ "azureKeyvaultSecretsProvider", new Pulumi.AzureNative.ContainerService.V20220902Preview.Inputs.ManagedClusterAddonProfileArgs
{
Config =
{
{ "enableSecretRotation", "true" },
},
Enabled = true,
} },
},
Originally I had AzureKVObjectId = cluster.AddonProfiles.Apply(x => x["azureKeyvaultSecretsProvider"].Identity.ClientId);
which worked but has since stopped working with a NullReferenceException.
Any idea on the correct way to retrieve the ObjectID of the identity that this creates?
Thanks!fast-vr-6049
04/26/2023, 7:29 PMastonishing-orange-99314
04/27/2023, 5:01 AMmammoth-agency-10350
04/27/2023, 10:01 PMfierce-lock-44528
04/28/2023, 12:18 PMfierce-lock-44528
04/28/2023, 12:20 PMfierce-lock-44528
04/28/2023, 12:22 PM