This message was deleted.
# getting-started
s
This message was deleted.
w
Since it’s a 404 error, that means the failure is happening in Azure. The error message appears to be saying the resourceName is not found:
Status=404 Code=“NotFound” Message=“Resource with ID ‘[REDACTED]/my-rg/mytenant123451234234523456456756789876.onmicrosoft.com’ does not exist.”
So, I would double/triple check that resource exists and is accessible.
👍 1
d
Hey @witty-candle-66007, thanks for looking into it! Yeah the tricky part is the resource that’s not found is the resource that’s being created here. So it doesn’t exist before we create it using Pulumi. I guess this error also looks like an async issue when Pulumi tries to access the tenant before it’s fully created - is there a way to maybe extend the waiting time before Pulumi access the new tenant? Cheers!
w
To make sure I’m not misunderstanding and since I’m not familiar with this resource, somewhere else in the code,
<http://mytenant123451234234523456456756789876.onmicrosoft.com|mytenant123451234234523456456756789876.onmicrosoft.com>
, is created and then referenced here. Is that correct?
d
Hey @witty-candle-66007 my understanding is slightly different. This whole code only creates the tenant and does nothing else. This code is pretty much a copy from the official Pulumi documentation here https://www.pulumi.com/docs/reference/pkg/azure-native/azureactivedirectory/b2ctenant/ and this is why I found it strange that it is not working out of the box 🤔
I think I finally made it work (though not very stable) by creating another tenant manually in the same Azure subscription - so I believe this is not really about the above Pulumi code here but rather Pulumi/Azure integration.
My assumption is, there is an issue with Azure API in some versions that might affect Pulumi. If you try it here in Microsoft sandbox https://docs.microsoft.com/en-us/rest/api/activedirectory/b2c-tenants/create with the API version
2019-01-01-preview
as they suggest, you will get response 201. Digging deeper into error I found there is an undocumented property required in the payload:
properties.tenantId
. Now if you add this property to the payload, and change the API version to
2017-01-30
(the only non-preview version), it results in response 200 and a successfully created B2C tenant.
I am not sure if these 2 issues are related though. My goal was to create a POC of creating B2C tenant using Pulumi and I reached it. But I still wonder why it had to be so complicated and not working out of the box. I hope this helps someone looking to automate this. Cheers!
w
I’m curious if you keep the 2019-01-01-preview version and include the
properties.tenantId
input, does it work?
d
It didn’t - the API returned 500 error