It should… Could you show a snippet of your code?
# azure
t
It should… Could you show a snippet of your code?
m
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
Try changing your snippet above to
source: new FileAsset(filePath)
. This should detect file changes OOTB.
m
@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
Oh wow, I guess I’m wrong then. I copied it from the S3 example without trying. Let me check…
m
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
@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
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
Thanks @melodic-byte-32771 I'll keep that in mind. However, I'd prefer a native solution. I'll see what Mikhail says.
m
sure 😉 If there is a fix I would be interessted too
t
@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
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
yes, that’s surprising… I’m really bad with Python, but this looks like a bug to me?
c
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
c
What do I know?! I'm just stumbling through these programming languages trying to make them work for me 🤣
c
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
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.