https://pulumi.com logo
#general
Title
# general
c

colossal-room-15708

05/08/2019, 12:00 PM
Anybody got an example for retrieving an azure storage account SAS token in python? This here doesn't work.
Copy code
sas_token = storage.GetAccountSASResult(
    connection_string=storage_account.primary_connection_string,
    https_only=False,
    resource_types=(
        service=False,
        container=False,
        object=True
    ),
    services=(
        blob=True,
        queue=False,
        table=False,
        file=False,
    ),
    start="2019-01-30",
    expiry="2028-03-21",
    permissions=(
        read=True,
        write=False,
        delete=False,
        list=False,
        add=False,
        create=False,
        update=False,
        process=False
    )
)
error:
Copy code
error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/home/david/.pulumi/bin/pulumi-language-python-exec", line 85, in <module>
        loop.run_until_complete(coro)
      File "/usr/lib/python3.6/asyncio/base_events.py", line 473, in run_until_complete
        return future.result()
      File "/home/david/.local/lib/python3.6/site-packages/pulumi/runtime/stack.py", line 34, in run_in_stack
        Stack(func)
      File "/home/david/.local/lib/python3.6/site-packages/pulumi/runtime/stack.py", line 93, in __init__
        func()
      File "/home/david/.pulumi/bin/pulumi-language-python-exec", line 84, in <lambda>
        coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
      File "/usr/lib/python3.6/runpy.py", line 275, in run_path
        mod_name, mod_spec, code = _get_main_module_details()
      File "/usr/lib/python3.6/runpy.py", line 219, in _get_main_module_details
        return _get_module_details(main_name)
      File "/usr/lib/python3.6/runpy.py", line 153, in _get_module_details
        code = loader.get_code(mod_name)
      File "<frozen importlib._bootstrap_external>", line 781, in get_code
      File "<frozen importlib._bootstrap_external>", line 741, in source_to_code
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "./__main__.py", line 41
        service=False,
               ^
    SyntaxError: invalid syntax
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
works in nodejs btw
Okay, might stick to nodejs then for now. Can't figure this out in python
all good in nodejs. Python is weird.
2 Views