sparse-intern-71089
05/12/2022, 9:16 AMcold-insurance-72507
05/13/2022, 8:29 AMFileArchive
? I can then upload it on an azure storage account and reference its url in the azure container registry task.
Pretty much the same idea of the azure functions run_from_package
https://github.com/pulumi/examples/blob/master/azure-cs-functions/FunctionsStack.cs
I can also use az acr build
directly with a Pulumi.Command but the command has problems when used in an azure devops pipeline and trying to understand what is going wrong it's not easy
https://github.com/pulumi/pulumi-command/issues/32
The azure cli (az) it is already installed by default on every azure pipeline hosted agenttall-librarian-49374
05/13/2022, 3:18 PMFileAsset
cold-insurance-72507
05/16/2022, 4:28 AM.tar.gz
it works, trying with a .zip or just passing the content of a folder to the FileArchive it does not.
Now I’m facing another error 😂, the build task runs successfully in azure container registry but seems there is something wrong in the Feature#WaitForCompletion
. I get this error:
Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=404 -- Original Error: Code="Creating" Message="The async operation failed." AdditionalInfo=[{"status":"Creating"}]
Seems something like this issue you found some time ago https://github.com/Azure/go-autorest/issues/596
I’m not able to find the specs about ACR task run here https://github.com/Azure/azure-rest-api-specs/blob/main/specification/containerreg[…]soft.ContainerRegistry/stable/2021-09-01/containerregistry.json
const string buyBuildTaskName = "buy-build-task";
var buyBuildTask = new ACR.Task(buyBuildTaskName, new TaskArgs
{
TaskName = buyBuildTaskName,
RegistryName = containerRegistry.Name,
ResourceGroupName = resourceGroup.Name,
Status = ACR.TaskStatus.Enabled,
IsSystemTask = false,
AgentConfiguration = new AgentPropertiesArgs
{
Cpu = 2
},
Identity = new IdentityPropertiesArgs
{
Type = ACR.ResourceIdentityType.SystemAssigned
},
Platform = new PlatformPropertiesArgs
{
Architecture = Architecture.Amd64,
Os = OS.Linux
},
Step = new DockerBuildStepArgs
{
ContextPath = BuildContextBlobUrl,
DockerFilePath = "Dockerfile.buy",
ImageNames =
{
BuyImageTag
},
IsPushEnabled = true,
NoCache = false,
Type = "Docker"
}
});
const string buyBuildTaskRunName = "buy-build-task-run";
var buyBuildTaskRun = new TaskRun(buyBuildTaskRunName, new TaskRunArgs
{
RegistryName = containerRegistry.Name,
ResourceGroupName = resourceGroup.Name,
ForceUpdateTag = "t2", //fake tag just to force the update
RunRequest = new TaskRunRequestArgs
{
TaskId = buyBuildTask.Id,
Type = "TaskRunRequest"
}
});
tall-librarian-49374
05/16/2022, 6:30 AMThe async operation failed
sounds like an Azure error. Any chance you can see its details in activity logs of the resource or resource group?cold-insurance-72507
05/16/2022, 6:33 AMcold-insurance-72507
05/16/2022, 7:13 AMcold-insurance-72507
05/16/2022, 7:18 AMtall-librarian-49374
05/16/2022, 8:50 AMcold-insurance-72507
05/16/2022, 9:41 AMtall-librarian-49374
05/16/2022, 9:41 AMcold-insurance-72507
05/16/2022, 10:38 AMtall-librarian-49374
05/16/2022, 11:07 AM--logflow
flag?cold-insurance-72507
05/16/2022, 11:20 AMcold-insurance-72507
05/16/2022, 11:22 AMtall-librarian-49374
05/16/2022, 11:43 AMcold-insurance-72507
05/16/2022, 12:39 PMcold-insurance-72507
05/16/2022, 1:21 PMcold-insurance-72507
05/16/2022, 1:25 PMcold-insurance-72507
05/16/2022, 4:44 PMAzure-Asyncoperation
the second time seems not correct --> /operationStatuses/cb1b/operationStatuses/cb1b is present two times --> this I suppose leads to a 404 not foundmysterious-mouse-98391
05/17/2022, 2:22 PMcold-insurance-72507
05/18/2022, 7:17 AMaz acr build
or the new az container app up
but I did not really understand how to do this using the pulumi azure provider. So I created a separate azure storage with a container and I upload the .tar.gz
of the docker build context there.
You can generate the SAS url of the blob and pass it to the task.
static Output<string> SignedBlobReadUrl(Storage.Blob blob, Storage.BlobContainer container, Storage.StorageAccount account, ResourceGroup resourceGroup)
{
var serviceSasToken = Storage.ListStorageAccountServiceSAS.Invoke(new Storage.ListStorageAccountServiceSASInvokeArgs
{
AccountName = account.Name,
Protocols = Storage.HttpProtocol.Https,
SharedAccessStartTime = "2022-05-01",
SharedAccessExpiryTime = "2022-12-31",
Resource = Storage.SignedResource.C,
ResourceGroupName = resourceGroup.Name,
Permissions = Storage.Permissions.R,
CanonicalizedResource = Output.Format($"/blob/{account.Name}/{container.Name}"),
ContentType = "application/json",
CacheControl = "max-age=5",
ContentDisposition = "inline",
ContentEncoding = "deflate",
}).Apply(blobSAS => blobSAS.ServiceSasToken);
return Output.Format($"https://{account.Name}.<http://blob.core.windows.net/{container.Name}/{blob.Name}?{serviceSasToken}%22);|blob.core.windows.net/{container.Name}/{blob.Name}?{serviceSasToken}");>
}
mysterious-mouse-98391
05/18/2022, 12:27 PMmysterious-mouse-98391
05/18/2022, 12:28 PMcold-insurance-72507
05/19/2022, 7:37 PMlistRegistryBuildSourceUploadUrl
but I didn't investigate it so much. But the problem relative to the task run is still here also in that case...failing the task run then fails also the deploy of the azure container app... in pulumi I mean...mysterious-mouse-98391
05/19/2022, 9:34 PMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by