https://pulumi.com logo
#azure
Title
# azure
t

tall-librarian-49374

02/01/2020, 9:41 PM
It should… Could you show a snippet of your code?
m

melodic-byte-32771

02/02/2020, 3:39 PM
like this it is not recognizing any changes in the file
But I wrote my own DynamicResource with the sync of azure function and checking against checksumChanges. Much faster 😉
If someone is interested:
t

tall-librarian-49374

02/03/2020, 7:59 AM
Try changing your snippet above to
source: new FileAsset(filePath)
. This should detect file changes OOTB.
m

melodic-byte-32771

02/05/2020, 8:40 PM
@tall-librarian-49374 @nice-guitar-97142 how have you managed this to work? The Blob args for the property source are only accepting Input<string> and no FileAsset
t

tall-librarian-49374

02/05/2020, 8:43 PM
Oh wow, I guess I’m wrong then. I copied it from the S3 example without trying. Let me check…
m

melodic-byte-32771

02/05/2020, 9:18 PM
for google cloud platform it was working with the FileAsset and i guess for S3 too.
so this should be implemented for the blob storage too. Would be nice but how I already said. I wrote a Provider for the sync command from azure which works too now.
c

colossal-room-15708

04/09/2020, 2:33 AM
@tall-librarian-49374 @melodic-byte-32771 I just tried
FileAsset()
(python) as well and it didn't work. The code however suggests that it should work. Error:
Copy code
azure:storage:Blob (install_scripts_storage_blob):
    error: unexpected asset source_content
Code:
Copy code
scripts_dir = "scripts"
file_path = os.path.join(scripts_dir,"install-adfs.ps1")
mime_type, _ = mimetypes.guess_type(file_path)

install_scripts_storage_blob = storage.Blob("install_scripts_storage_blob",
  name="install.ps1",
  storage_account_name=install_scripts_storage_account.name,
  storage_container_name=install_scripts_storage_container.name,
  source_content=FileAsset(file_path),
  type="Block",
  content_type=mime_type
)
m

melodic-byte-32771

04/09/2020, 4:15 AM
I wrote my own dynamic provider with syncs the files directly with the native azzure cli (works faster). Do you want the code snippet?
usage:
c

colossal-room-15708

04/09/2020, 4:25 AM
Thanks @melodic-byte-32771 I'll keep that in mind. However, I'd prefer a native solution. I'll see what Mikhail says.
m

melodic-byte-32771

04/09/2020, 4:47 AM
sure 😉 If there is a fix I would be interessted too
t

tall-librarian-49374

04/09/2020, 7:39 AM
@colossal-room-15708 Are you on 2.x of the provider? This TS example definitely works: https://github.com/pulumi/examples/blob/master/azure-ts-static-website/index.ts#L29
Btw. why is it
source_content
and not
source
?
c

colossal-room-15708

04/09/2020, 7:41 AM
Copy code
pulumi==1.13.0
pulumi-azure==2.2.0
pulumi_random==1.6.0
ah, damn... auto-complete slipped down to
source_content
source
works...
🤦
When looking at the implementation, I find it confusing that the description of properties in python is under the property, where in TS it's above
t

tall-librarian-49374

04/09/2020, 8:04 AM
yes, that’s surprising… I’m really bad with Python, but this looks like a bug to me?
c

colossal-room-15708

04/09/2020, 8:17 AM
Maybe, not sure?! I'm equally dangerous with python as I am with TS 😉
let's see what others might say: https://github.com/pulumi/pulumi/issues/4343
t

tall-librarian-49374

04/09/2020, 8:25 AM
c

colossal-room-15708

04/09/2020, 8:59 AM
What do I know?! I'm just stumbling through these programming languages trying to make them work for me 🤣
c

clever-sunset-76585

04/09/2020, 4:09 PM
David, I am curious to see if you find https://www.pulumi.com/docs/reference/pkg/azure/storage/blob/ helpful? I realize you were probably look at the Python SDK source from within your IDE, so it probably isn't the same in terms of accessibility, but still wondering what you think. (We announced the new set of "resource"-oriented docs recently in https://pulumi-community.slack.com/archives/CB36DSVSA/p1585696360024400) We are continuing to work on improvements for these new resource oriented docs. EDIT: We will be working on adding the ability to link to a specific property in a language.
c

colossal-room-15708

04/09/2020, 10:23 PM
This is so much better, @clever-sunset-76585. Right now, I check the code in my IDE, if that isn't any help I follow the link to terraform, which sometimes helps, but not always. If you can replace all the terraform links with links to your own documentation, that would be awesome.
3 Views